#include <stdio.h>
#include <stdlib.h>

int* get_num(char* str)
{
	static int* result;
	result = malloc(sizeof(int));
	int i = 0, j = 0;
	char tmp, next;
	next = 1;
	while ((tmp = *(str + i)) != '\0')
	{
		i++;
		if (tmp <= 57 && tmp >= 48) //ACSII数字编码
		{
			int num = atoi(&tmp);
			if (next) //下一个数字
			{
				j++;
				result = realloc(result, sizeof(int) * (j));
				*(result + j-1) =  num;
				next = 0;
				continue;
			}
			*(result + j-1) = *(result + j-1) * 10 + num;
			continue;
		}
		next = 1;
	}
	j++;
	result = realloc(result, sizeof(int) * (j));
	*(result + j-1) = -1;
	return result;
}
int main()
{
	char static input[] = "2134Xjd9au^654&da5";
	int* i = get_num(&input);
	int j = 0;
	while (*i != -1)
	{
		printf("%d\n", *i);
		i++;
		j++;
	}
	printf("total :%d", j);
}